import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins'

// 全局注册 typeNav 组件
import TypeNav from '@/pages/Home/typeNav'
// 全局注册轮播图组件
import Carousel from '@/components/Carousel'
// 注册全局分页器
import pagination from '@/components/pagination'

Vue.component('type-nav', TypeNav)
Vue.component('carousel', Carousel)
Vue.component('pagination', pagination)

// 注册全局样式表
import './assets/global.css'

// 引入mock 数据
import './mockjs/mockServe'

// 引入 swiper样式
import 'swiper/css/swiper.css'

Vue.config.productionTip = false

// 引入全局API
import * as API from '@/api'

// 引入表单验证规则
import '@/plugins/validate'

// 引入图片懒加载
import '@/plugins/lazyLoad'

new Vue({
  // 注册全局事件总线
  beforeCreate() {
    Vue.prototype.$bus = this
    Vue.prototype.$Api = API
  },
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
